package com.pks.datacenter.utils;

import java.util.List;

import com.alibaba.fastjson.JSONObject;
import com.pks.datacenter.entity.basic.DbInfo;
import com.pks.datacenter.entity.basic.DbSource;

public class SutilTrans {

	
	public static void main(String[] args) throws Exception {
		DbSource source = new DbSource();
		source.setDb_type(SUtilDb.dbtype_mysql);
		source.setDb_ip("10.131.2.180");
		source.setDb_port(3306);
		source.setDb_name("tcms");
		source.setDb_account("root");
		source.setDb_password("sQyARsjXny5q");
		DbSource target = new DbSource();
		target.setDb_type(SUtilDb.dbtype_mysql);
		target.setDb_ip("10.131.13.31");
		target.setDb_port(3306);
		target.setDb_name("tcms");
		target.setDb_account("root");
		target.setDb_password("Thanone123.");
		List<JSONObject> queryDbTableList = SUtilDb.queryDbTableList(source.getDb_type(), source.getDb_ip(), source.getDb_port(), source.getDb_name(), source.getDb_account(), source.getDb_password());
		for (JSONObject jsonObject : queryDbTableList) {
			System.out.println(jsonObject.getString("TABLE_NAME")+":" + jsonObject.getLongValue("TABLE_ROWS"));
		}
	}
}
